export function runAllApiTest(classToTest: Object, filterKeys: string[]) {
  let lastKey = ''
  for (let key in classToTest) {
    if (typeof classToTest[key] === 'function') {
      if (filterKeys.includes(key)) {
        continue
      } else if (key === 'buildTest' || key === 'registerTest') {
        lastKey = key;
      } else {
        classToTest[key]();
      }
    }
  }
  if (lastKey !== '') {
    classToTest[lastKey]()
  }
}

export function isSameClass(objA: Object, objB: Object) {
  return (Object.getPrototypeOf(objA) === Object.getPrototypeOf(objB))
}

/**
 * 浅拷贝
 * */
export function shallowCopy(obj: object): object {
  let newObj: Record<string, Object> = {};
  for (let key of Object.keys(obj)) {
    newObj[key] = obj[key];
  }
  return newObj;
}